//
//  ViewController.m
//  faceID
//
//  Created by Heaton_Parker on 2020/4/30.
//  Copyright © 2020 Heaton_Parker. All rights reserved.
//

#import "ViewController.h"
#import "unlockTool.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [unlockTool shareInstance];
    // Do any additional setup after loading the view.
}

- (IBAction)unlockTapped:(id)sender {
   [[unlockTool shareInstance] unlockWithResultBlock:^(UnlockResult result, NSString * _Nonnull errMsg) {
        if(result == unlockChangeed){
            dispatch_async(dispatch_get_main_queue(), ^{
                [self presentAlert];
            });
        }
        NSLog(@"解锁:%ld",result);
    }];
}


-(void)presentAlert{
    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"警  告" message:@"面容发生变化,请联系客户为你重设" preferredStyle:UIAlertControllerStyleAlert];
    UIAlertAction *centain = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:nil];
    [alert addAction:centain];
    [self presentViewController:alert animated:YES completion:nil];
}
@end
